#ifndef BASECONNECTION_H
#define BASECONNECTION_H

#include <QThread>

#include "common.h"
#include "networktests.h"

class BaseConnection : public QObject
{
    Q_OBJECT

public:
    explicit BaseConnection(QObject *parent = 0);

    void setPortNumber(int newPortNumber);
    void setIPAddress(int *newIPAddress);

    int getPortNumber();
    int *getIPAddress();

private:
    int _ipAddress[4];
    int _portNumber;
    NetworkTests _networkTestThread;

public slots:
    void runPingTest();
    void passOnPingTestResults(float pingResult);

    virtual void sendMessge(QString message, QString *parameters, int parameterCount) = 0;
    virtual void startConnection() = 0;
    virtual void endConnection() = 0;
    virtual GCSCommon::ConnectionStatus getConnectionStatus() = 0;

signals:
    void connectionHasData(QString dataString);
    void pingTestCompleted(float pingResult);
    
    void processedDataAvailable(QString processedData);

};

#endif // BASECONNECTION_H
